<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./MainTemplate.xhtml">
            <ui:define name="head">
                <script type="text/javascript">
                ( function($) {
                    // Make tab item 'Listing' on menu is active
                    $(document).ready( function() { $('#listing').addClass("active"); });
                }) ( jQuery );
                </script>
            </ui:define>

            <ui:define name="title">
                Register RadioCabs Company
            </ui:define>

            <ui:define name="left">
                <h:form>
                    <h1 class="title">Register RadioCabs Company</h1>
                    <h4 style="text-align: justify">Website provides listing of RadioCabs Company from all over VietNam. Team1 Radio Cabs is having 3 different type of Membership - Premium, Basic, Free .
                        <br/><br/> If you are a RadioCab Operator, feel free to register here and get listed in website.</h4>
                    <h:panelGrid columns="3" cellpadding="10" id="panel">
                        <h:outputLabel value="Company Name:" style="font-weight: bold;"/>
                        <p:inputText id="name" value="#{companyBean.name}" required="true" requiredMessage="Please insert your name!"/>
                        <p:message for="name"/>

                        <h:outputLabel value="Email:" style="font-weight: bold;"/>
                        <p:inputText id="email" value="#{accountBean.email}" required="true" requiredMessage="Please insert your email!"/>
                        <p:message for="email"/>

                        <h:outputLabel value="Password:" style="font-weight: bold;"/>
                        <p:password id="password" value="#{accountBean.password}" label="Password" required="true" requiredMessage="Please insert your password!"/>
                        <p:message for="password"/>

                        <h:outputLabel value="Contact Person:" style="font-weight: bold;"/>
                        <p:inputText id="contact" value="#{companyBean.contactPerson}" required="true" requiredMessage="Please insert contact person!"/>
                        <p:message for="contact"/>

                        <h:outputLabel value="Designation:" style="font-weight: bold;"/>
                        <p:inputText id="designation" value="#{companyBean.designation}" required="true" requiredMessage="Please insert designation!"/>
                        <p:message for="designation"/>

                        <h:outputLabel value="Address:" style="font-weight: bold;"/>
                        <p:inputText id="address" value="#{companyBean.address}" required="true" requiredMessage="Please insert address!"/>
                        <p:message for="address"/>

                        <h:outputLabel value="Mobile:" style="font-weight: bold;"/>
                        <p:inputText id="mobile" value="#{companyBean.mobile}" required="true" requiredMessage="Please insert mobile!"/>
                        <p:message for="mobile"/>

                        <h:outputLabel value="Telephone:" style="font-weight: bold;"/>
                        <p:inputText id="telephone" value="#{companyBean.telephone}" required="true" requiredMessage="Please insert telephone"/>
                        <p:message for="telephone"/>

                        <h:outputLabel value="Fax:" style="font-weight: bold;"/>
                        <p:inputText id="fax" value="#{companyBean.fax}" required="true" requiredMessage="Please insert FAX!"/>
                        <p:message for="fax"/>

                        <h:outputLabel value="Member Type:" style="font-weight: bold;"/>
                        <h:selectOneMenu id="membertype" value="#{companyBean.memberType}">
                            <f:selectItem itemValue="Premium" itemLabel="Premium"></f:selectItem>
                            <f:selectItem itemValue="Basic" itemLabel="Basic"></f:selectItem>
                            <f:selectItem itemValue="Free" itemLabel="Free"></f:selectItem>
                        </h:selectOneMenu>
                        <p:message for="membertype"/>

                        <h:outputLabel value="Payment Type:" style="font-weight: bold;"/>
                        <h:selectOneMenu id="paymenttype" value="#{paymentBean.paymentType}">
                            <f:selectItem itemValue="Cash" itemLabel="Cash"></f:selectItem>
                            <f:selectItem itemValue="Bank" itemLabel="Bank"></f:selectItem>
                        </h:selectOneMenu>
                        &nbsp;

                        <h:outputLabel value="Extension Day:" style="font-weight: bold;"/>
                        <p:inputText id="amount" value="#{paymentBean.amount}" required="true" requiredMessage="Please insert extension day!"/>
                        <h:selectOneMenu id="extensionday" value="#{paymentBean.extensionType}">
                            <f:selectItem itemValue="Monthly" itemLabel="Monthly"></f:selectItem>
                            <f:selectItem itemValue="Quaterly" itemLabel="Quaterly"></f:selectItem>
                        </h:selectOneMenu>
                        &nbsp;
                    </h:panelGrid>
                    <p:commandButton ajax="false" value="Register" action="#{companyController.processRegister}" update="panel"/>&nbsp;
                    <p:commandButton value="Reset" type="Reset" update="panel"/>
                </h:form>
            </ui:define>

            <ui:define name="right">
            </ui:define>

        </ui:composition>

    </body>
</html>
